﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MaterialList.aspx.cs" Inherits="Material_MaterialList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>正贸仓储物流管理系统</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        function fPopUpDlg(URL, Target, form)  //
        {
            now = new Date();
            var rom;
            var rom1
            rom = Math.ceil(Math.random() * 10000);
            rom1 = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + rom;
           // document.getElementById('<%=hidden.ClientID %>').value = window.showModalDialog("AddMaterial.aspx?radmom=" + rom1, window, "dialogWidth=600px;dialogHeight=218px;scroll:no;resizable:no;status:0;");
            window.open("AddMaterial.aspx?radmom=" + rom1 + "", 'win', "Height=250px,Width=700px,top=180, left=500, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
            document.URL = location.href;
        }

        function SelectAllCheckBox() {
            var form = document.forms[0];
            for (i = 0; i < form.elements.length; i++) {
                if (form.elements[i].checked == false) {
                    j = 0;
                }
                else {
                    j = 1;
                }
            } if (j == 0) {
                for (i = 0; i < form.elements.length; i++) {
                    if (!form.elements[i].disabled) {
                        form.elements[i].checked = true;
                    }
                }
            }
            else {
                for (i = 0; i < form.elements.length; i++) {
                    if (!form.elements[i].disabled) {
                        form.elements[i].checked = false;
                    }
                }
            }
        }
        
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="height: 30px">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_03.gif); background-repeat: repeat-x;
                                width: 12px;">
                                &nbsp;
                            </td>
                            <td style="background-image: url(../images/tab_05.gif); background-repeat: repeat-x;
                                height: 30px;">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 46%; vertical-align: middle;">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td style="width: 5%; vertical-align: middle;">
                                                        <img src="../images/tb.gif" width="16" height="16" />
                                                    </td>
                                                    <td style="width: 95%;">
                                                        <span>你当前的位置</span>：基础数据-物料列表
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="54%">
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="16" style="background-image: url(../images/tab_07.gif); height: 30px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_12.gif); width: 8px;">
                                &nbsp;
                            </td>
                            <td>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                    <tr>
                                        <td style="padding: 2px;">
                                            <table width="100%" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                                <tr style="height: 22px;">
                                                    <td style="width: 10%" align="right">
                                                        物料编码：
                                                    </td>
                                                    <td style="width: 15%; padding-left: 2px;">
                                                        <asp:TextBox ID="txtMat_Code" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6;
                                                            font-size: 9pt;"></asp:TextBox>
                                                    </td>
                                                    <td style="width: 10%" align="right">
                                                        物料名称：
                                                    </td>
                                                    <td style="width: 15%; padding-left: 2px;">
                                                        <asp:TextBox ID="txtMat_Name" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6;
                                                            font-size: 9pt;"></asp:TextBox>
                                                    </td>
                                                    
                                                </tr>
                                                 <tr>
                                                     <td align="right">物料频率：</td>
                                                        <td style="padding-left: 2px;" >
                                                           <asp:DropDownList ID="ddlGroupType" runat="server" DataValueField="MaterialGroupType" DataTextField="MaterialGroupName" AutoPostBack="True"  
                                                             Style="width: 150px;height: 20px; border: solid 1px #b5d6e6;">
                                                           </asp:DropDownList>
                                                        </td>
                                                       <td align="right">规格型号：</td>
                                                        <td style="padding-left: 2px;">
                                                            <asp:TextBox ID="txt_S01" runat="server" Style="width: 150px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"
                                                                    MaxLength="30"></asp:TextBox>
                                                        </td>
                                                     <td style="padding-left: 2px;">
                                                        <asp:ImageButton ID="ibtnSearch" runat="server" ImageUrl="~/Images/btn/btn_Search.gif"
                                                            OnClick="ibtnSearch_Click" />
                                                        <asp:ImageButton ID="ibtnAdd" runat="server" ImageUrl="~/Images/btn/btn_add.gif"
                                                            OnClientClick="fPopUpDlg()" />
                                                        <asp:ImageButton ID="ibtnDel" runat="server" ImageUrl="~/Images/btn/Delete.gif" OnClick="ibtnDel_Click"  OnClientClick="return confirm('确定删除此物料信息？')"/>
                                                        <asp:ImageButton ID="ibtn_ERP" runat="server" ImageUrl="~/Images/btn/btn_ERP.gif"
                                                            OnClick="ibtn_ERP_Click" Visible="False"  />
                                                        <%--<asp:ImageButton ID="ibtn_DR" runat="server" 
                                                            ImageUrl="~/Images/btn/btn_DaoRu.gif" onclick="ibtn_DR_Click" />--%>
                                                    </td>
                                                    </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr >
                                       <td align="center" style="padding: 2px;">
                                            <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 530px; overflow-x: auto;
                                                overflow-y: auto;">
                                                <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" Width="100%" BorderWidth="1px"
                                                BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="PID" AllowPaging="True" PageSize="100" OnPageIndexChanging="gv_PageIndexChanging"
                                                OnRowDataBound="gv_RowDataBound">
                                                <Columns>
                                                    <asp:TemplateField>
                                                        <HeaderTemplate>
                                                            <input id="hchkSelect" type="checkbox" onclick="SelectAllCheckBox()" />
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="chkSelect" runat="server" />
                                                        </ItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="序号">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="物料编码">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lbtn_Mat_Code" runat="server" Text='<%# Bind("Mat_Code") %>'
                                                                ForeColor="Blue" CommandArgument='<%# Bind("Mat_Code") %>'></asp:LinkButton>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="10%" />
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="Mat_Name" HeaderText="物料名称">
                                                        <ItemStyle Width="10%" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="S01" HeaderText="规格">
                                                        <ItemStyle Width="8%" />
                                                    </asp:BoundField>
                                                     <asp:BoundField DataField="TM03" HeaderText="长度">
                                                           <ItemStyle Width="4%" />
                                                    </asp:BoundField>
                                                       <asp:BoundField DataField="TM01" HeaderText="材质">
                                                           <ItemStyle Width="6%" />
                                                    </asp:BoundField>
                                                           <asp:BoundField DataField="Unit_Base" HeaderText="单位">
                                                        <ItemStyle Width="4%" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="MaterialGroupName" HeaderText="物料频率">
                                                        <ItemStyle Width="6%" />
                                                    </asp:BoundField>
                                                     <asp:TemplateField HeaderText="创建方式">
                                                          <ItemTemplate>
                                                             <asp:Label ID="lbOID" runat="server" Text='<%# Bind("OID") %>'></asp:Label>
                                                         </ItemTemplate>
                                                         <ItemStyle Width="4%" />
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="MiniNum" HeaderText="最低限值">
                                                        <ItemStyle Width="10%" />
                                                    <ItemStyle Width="5%" />
                                                    </asp:BoundField>
                                                      <asp:BoundField DataField="S02" HeaderText="备注">
                                                        <ItemStyle Width="10%" />
                                                    <ItemStyle Width="8%" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="CDT" HeaderText="日期">
                                                        <ItemStyle Width="10%" />
                                                    </asp:BoundField>

                                                </Columns>
                                                <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                            </asp:GridView>
                                            </div>
                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <webdiyer:AspNetPager ID="pager" runat="server" UrlPaging="true" PageSize="2" NumericButtonTextFormatString="[{0}]"
                                                TextAfterInputBox="" ShowBoxThreshold="2" Width="68%" OnPageChanged="pager_PageChanged">
                                            </webdiyer:AspNetPager>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="background-image: url(../images/tab_15.gif); width: 8px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="background-image: url(../images/tab_19.gif); height: 35px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="width: 12px; height: 35px;">
                                <img src="../images/tab_18.gif" width="12" height="35" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td width="16">
                                <img src="../images/tab_20.gif" width="16" height="35" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hidden" runat="server" />
    </div>
    </form>
</body>
</html>
